package hu.gar.core.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "USER_TO_ROLE")
public class UserToRole extends BaseEntity {

	private static final long serialVersionUID = 4185267740737996145L;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_FK", nullable = false)
	protected User user;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ROLE_FK", nullable = false)
	protected Role role;

	public UserToRole() {
	}

	public UserToRole(Long id, User user, Role role) {
		this.id = id;
		this.user = user;
		this.role = role;
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getRecUserId() {
		return this.recUserId;
	}

	public void setRecUserId(String recUserId) {
		this.recUserId = recUserId;
	}

	public Date getRecDate() {
		return this.recDate;
	}

	public void setRecDate(Date recDate) {
		this.recDate = recDate;
	}

	public String getModUserId() {
		return this.recUserId;
	}

	public void setModUserId(String modUserId) {
		this.modUserId = modUserId;
	}

	public Date getModDate() {
		return this.modDate;
	}

	public void setModDate(Date modDate) {
		this.modDate = modDate;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}
}